<template>
  <ul class="node-model">
    <li class="t_start" @mousedown="mousedown('start_node')" @mouseup="mouseup">开始</li>
    <li class="t_normal" @mousedown="mousedown('normal_node')" @mouseup="mouseup">流程</li>
    <!-- <li class="t_exigency" @mousedown="mousedown('exigency_node')" @mouseup="mouseup">Exigency</li> -->
    <li class="t_warning" @mousedown="mousedown('warning_node')" @mouseup="mouseup">抄送</li>
    <li class="t_end" @mousedown="mousedown('end_node')" @mouseup="mouseup">结束</li>
  </ul>
</template>

<script>
export default {
  name: 'LeftPanel',
  inject: ['FlowDT'],
  data() {
    return {}
  },
  methods: {
    mouseup() {
      this.$nextTick(() => {
        this.FlowDT.$graph.setMode('default')
      })
    },
    mousedown(type) {
      // console.log('拖拽添加节点', type)
      //保存拖拽节点的类型,drag_add交互行为会用到
      this.FlowDT.dragType = type
      this.$nextTick(() => {
        this.FlowDT.$graph.setMode('drg_add')
      })
    },
  },
}
</script>
